from django.conf.urls import url,include
from .views import IndexViews,OrderViews,GoodsViews,TypesViews,UsersViews,authviews

urlpatterns = [
    # 后台首页
    url(r'^$', IndexViews.index,name='myadmin_index'),

    # 后台登陆页面
    url(r'^login/$', authviews.mylogin,name='myadmin_login'),
    # 后台退出页面    
    url(r'^logout/$', authviews.mylogout,name='myadmin_logout'),


    url(r'^user/add/$', UsersViews.user_add,name='myadmin_user_add'),
    url(r'^user/insert/$', UsersViews.user_insert,name='myadmin_user_insert'),
    url(r'^user/index/$', UsersViews.user_index,name='myadmin_user_index'),
    url(r'^user/deluser/$', UsersViews.user_deluser,name='myadmin_user_deluser'),
    
    url(r'^user/setuser/$', UsersViews.user_setuser,name='myadmin_user_setuser'),

    url(r'^user/uodate/$', UsersViews.user_uodate,name='myadmin_user_uodate'),

    # 后台权限管理

    # 后台用户添加
    url(r'^auth/user/add$',authviews.useradd,name='auth_user_add'),
    # 后台用户列表
    url(r'^auth/user/list$',authviews.userlist,name='auth_user_list'),
    url(r'^auth/user/del/(?P<uid>[0-9]+)$',authviews.userdel,name='auth_user_del'),


    # 后台组添加
    url(r'^auth/group/add$',authviews.groupadd,name='auth_group_add'),
    # 后台组列表
    url(r'^auth/group/list$',authviews.grouplist,name='auth_group_list'),
    url(r'^auth/group/edit/(?P<gid>[0-9]+)$',authviews.groupedit,name='auth_group_edit'),


    # 商品分类
    url(r'^type/add/$', TypesViews.type_add,name='myadmin_type_add'),
    url(r'^type/insert/$', TypesViews.type_insert,name='myadmin_type_insert'),
    # 显示商品分类
    url(r'^type/index/$', TypesViews.type_index,name='myadmin_type_index'),
    # 删除商品分类
    url(r'^type/delete/$', TypesViews.type_delete,name='myadmin_type_delete'),
    # 更改name 值
    url(r'^type/update/$', TypesViews.type_update,name='myadmin_types_update'),


    # 商品管理
    url(r'^good/add/$', GoodsViews.good_add,name='myadmin_good_add'),
    url(r'^good/insert/$', GoodsViews.good_insert,name='myadmin_good_insert'),  
    # 商品列表
    url(r'^good/index/$', GoodsViews.good_index,name='myadmin_good_index'),
    # 商品删除
    url(r'^good/delete/$', GoodsViews.good_delete,name='myadmin_good_delete'),
    # 商品修改
    url(r'^good/setgood/$', GoodsViews.good_setgood,name='myadmin_good_setgood'),
    url(r'^good/update/$', GoodsViews.good_update,name='myadmin_good_update'),


    # 订单管理
    url(r'^order$', OrderViews.order_index,name='myadmin_order_index'),


]